<!DOCTYPE HTML>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<meta name="misapplication-tap-highlight" content="no" />
		<meta name="HandheldFriendly" content="true" />
		<meta name="MobileOptimized" content="320" />
		<title>Hello H5+</title>
		<script type="text/javascript" src="js/common.js"></script>
		<script type="text/javascript">
			function getAcc() {
				outSet('获取设备当前加速度');
				plus.accelerometer.getCurrentAcceleration(function(a) {
					outLine('X轴：' + a.xAxis + '\nY轴：' + a.yAxis + '\nZ轴：' + a.zAxis);
				}, function(e) {
					outLine('获取失败:' + e.message);
				});
			}
			var aid = null;

			function watchAcc() {
				if (aid) {
					return;
				}
				outSet('监听设备加速度变化');
				aid = plus.accelerometer.watchAcceleration(function(a) {
					outSet('监听设备加速度变化\n' + 'X轴：' + a.xAxis + '\nY轴：' + a.yAxis + '\nZ轴：' + a.zAxis);
				}, function(e) {
					outLine('监听失败:' + e.message);
				});
			}

			function watchStop() {
				if (aid) {
					outSet('停止监听设备加速度变化');
					plus.accelerometer.clearWatch(aid);
					aid = null;
				} else {
					outSet('没有监听设备加速度变化');
				}
			}
		</script>
		<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
		<link rel="stylesheet" type="text/css" href="css/mui.css" />
	</head>
	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">标题</h1>
		</header>
		<div id="dcontent" class="dcontent">
			<br />
			<div class="button" id="shake">
				摇一摇
			</div>
			<div class="button" id="btn">
				二维码扫描
			</div>
			<div class="button" id="photo">
				照相
			</div>
		</div>
	</body>
	<script type="text/javascript" src="js/immersed.js"></script>
	<script src="js/mui.js" type="text/javascript" charset="utf-8"></script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.min.js" type="text/javascript"></script>
	<script type="text/javascript">
		mui.init()

		mui.plusReady(function() {
			console.log('加载完成');

			mui('.dcontent').on('tap', '#shake', function() {
				console.log(11111)
				mui.openWindow({
					url: 'shake.html',
					id: 'shake.html',
					styles: {
						top: '0px',
						bottom: '50px'
					}
				})
			})
			
			mui('.dcontent').on('tap', '#btn', function() {
				console.log(22222)
				mui.openWindow({
					url: 'shake.html',
					id: 'shake.html',
					styles: {
						top: '0px',
						bottom: '50px'
					}
				})
			})
			
			mui('.dcontent').on('tap', '#photo', function() {
				console.log(33333)
				mui.openWindow({
					url: 'photo.html',
					id: 'photo.html',
					styles: {
						top: '0px',
						bottom: '50px'
					}
				})
			})
		})
	</script>
</html>
